package com.magist.manage.system.service.impl;

import java.util.Date;
import java.util.List;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.magist.core.entity.Page;
import com.magist.core.entity.Params;
import com.magist.core.service.SimpleServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.magist.manage.system.dao.OffContactMapper;
import com.magist.manage.system.entity.OffContact;
import com.magist.manage.system.service.OffContactService;
import org.springframework.util.CollectionUtils;

@Service
public class OffContactServiceImpl extends SimpleServiceImpl<OffContact> implements OffContactService{

	@Autowired
	private OffContactMapper offContactMapper;

	@Override
	public boolean isAttack(String ip) {
		// 判断是否
		List<OffContact> offContacts = offContactMapper.findTodaySubmit(ip);
		if (!CollectionUtils.isEmpty(offContacts)) {
			return offContacts.size() >= 5;
		}
		return false;
	}
}